package aop.spring;
import org.aopalliance.MethodInterceptor;
import org.aopalliance.MethodInvocation;
public class TraceInterceptor implements MethodInterceptor {
	public Object invoke(Invocation invocation) throws Throwable {
		String methodName = invocation.getMethod().getName();
		System.out.println("-> Before "+methodName);
		Object rsp = invocation.proceed();
		System.out.println("-> After "+methodName);
		return rsp;
	}  
}

public class DebugInterceptor implements MethodInterceptor {

    public Object invoke(MethodInvocation invocation) throws Throwable {
        System.out.println("Before: invocation=[" + invocation + "]");
        Object rval = invocation.proceed();
        System.out.println("Invocation returned");
        return rval;
    }
}